package com.mobile2you.nci.android.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.mobile2you.nci.android.R;
import com.mobile2you.nci.android.domain.Centres;

public class BulleDialog extends Dialog {

	public interface onBullClickListener {

		public void onBullClick(Centres centre);
	}

	public BulleDialog(Context context, final Centres ticket,
			final onBullClickListener onBullClickListener) {
		super(context);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(R.layout.marker_dialog);
		setCanceledOnTouchOutside(true);
		TextView name = (TextView) findViewById(R.id.centrer_name);
		name.setText(ticket.getTitle());
		View v = findViewById(R.id.bulle_parent);
		v.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				dismiss();
				Utils.centreSelected = ticket;
				if (onBullClickListener != null) {
					onBullClickListener.onBullClick(ticket);
				}

			}
		});
	}
}
